package org.linlinjava.litemall.db.dao;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.*;

public interface OrderMapper {
    int updateWithOptimisticLocker(@Param("lastUpdateTime") LocalDateTime lastUpdateTime, @Param("order") LitemallOrder order);
    List<Map<String, Object>> queryGoodsSales(@Param("map") Map<String, Object> map);
    List<Map<String, Object>> queryGoodsCategorySales(@Param("map") Map<String, Object> map);
	List<Map<String, Object>> queryOrderGoodsNum(@Param("type") String type);

    List<LitemallOrder> queryOrderWithUserId(@Param("userId") Integer userId);

    Integer getTodayMaxSericalNo(@Param("shopId") Integer shopId);

    List<OrderMonthStatisticsVo> monthStatistics(
    		@Param("startTime") String startTime,
    		@Param("endTime") String endTime,
    		@Param("regionId") Integer regionId,
    		@Param("shopId") Integer shopId);

    List<OrderDayStatisticsVo> dayStatistics(
    		@Param("startTime") String startTime,
    		@Param("endTime") String endTime,
    		@Param("shopId") Integer shopId,
			@Param("orderSource")Integer orderSource);

    List<OrderHourStatisticsVo> hourStatistics(
    		@Param("searchDate") String searchDate,
			@Param("time") String time,
    		@Param("shopId") Integer shopId);

    OrderTotalStatisticsVo totalStatistics(
    		@Param("startTime") String startTime,
    		@Param("endTime") String endTime,
    		@Param("regionId") Integer regionId,
    		@Param("shopId") Integer shopId);

	OrderRefundTotalStatisticsVo refundTotalStatistics(@Param("startTime") String startTime,
													   @Param("endTime") String endTime,
													   @Param("regionId") Integer regionId,
													   @Param("shopId") Integer shopId);
}
